/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package LogicadeNegocio;
import CapadeDatos.DaoVerFamiliaCarrera;
import java.util.ArrayList;
import java.util.Iterator;
import javax.swing.JComboBox;
import javax.swing.JTextField;
import modelo.beanfamiliacarrera;
/**
 *
 * @author hans
 */
public class combofamiliacarrera {
    JComboBox jcombofamilia;
    ArrayList lista;
    beanfamiliacarrera[] detalles;
    JTextField textbox;
    public combofamiliacarrera(JComboBox combo){
        jcombofamilia = combo;
    }
     public void cargarfamilia() throws Exception{
     // Llamamos al metodo datos modulo que nos devuelve el ArrayList
      lista = (ArrayList) DaoVerFamiliaCarrera.listaItem();
      detalles = new beanfamiliacarrera[lista.size()];
      Iterator itr = lista.iterator();
      int j=0;
      jcombofamilia.removeAllItems();
      while (itr.hasNext()) {
          detalles[j] =  (beanfamiliacarrera) itr.next();
          jcombofamilia.addItem(detalles[j].getNombrefamilia());        
          j++;
      }

    }
    public  beanfamiliacarrera[] carrera(){
      return detalles;
    }
}

